Grant Tables & mm.c
I was looking at the user space grant tables but i did not find any code calling the function "remap_pfn_range" to map the kmalloc ed allocated memory into user space.
What could be the reason?? Or am i missing something
Thanks Mark.
----- Original Message ----
From: Mark Williamson <[email protected]>
To: Koripella Srinivas <[email protected]>
Cc: [email protected]
Sent: Friday, 6 July, 2007 9:55:48 AM
Subject: Re: [Xen-devel] Grant Tables & mm.c
Quoted 4 lines
" Linux tends to zap userspace page mappings quite cheerfully unless you do something to stop it, could this be your problem?"
What does this mean exactly??
Linux "zaps" mappings when it removes them from pagetables. Really this corresponds to zeroing a pte corresponding to that mapping.
Unless you do something to stop the Linux mm system from treating the grant table mappins like "normal" RAM, it will eventually want to simply zero them. This will break for grant mappings, since it is not a permitted means of unmapping granted memory.
Quoted 1 line
Any way i can prevent it from happening?
It depends on what you're trying to do...
Have you looked at the userspace grantables driver in our Linux tree? This provides a device for mapping granted memory safely into userspace, handling cleanup correctly. Even if that's not directly useful, maybe you can find some code in there that'll help you.
Cheers,
Mark
Signature · 15 lines
Dave: Just a question. What use is a unicyle with no seat? And no pedals! Mark: To answer a question with a question: What use is a skateboard? Dave: Skateboards have wheels. Mark: My wheel has a wheel! __________________________________________________________ Yahoo! India Answers: Share what you know. Learn something new http://in.answers.yahoo.com/
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel
Quoted 3 lines · Koripella Srinivas
I was looking at the user space grant tables but i did not find any code calling the function "
remap_pfn_range" to map the kmalloc ed allocated memory into user space.
What could be the reason?? Or am i missing something
The mapping takes place in drivers/xen/gntdev/gntdev.c, in the function gntdev_mmap(). In the normal case (no shadow page tables), the page is mapped into user space by calling HYPERVISOR_grant_table_op, with the GNTTABOP_map_grant_ref operation, and (amongst other things) a pointer to the page table entry to be rewritten. Therefore, it is not necessary to call remap_pfn_range().
I'm not sure what you mean by "the kmalloc ed allocated memory". The memory is allocated by another domain, and inserted in the grant table. In the kernel that carries out the mapping, kmalloc is used only for allocating kernel-private data structures.
Regards,
Derek Murray.
question regarding struct xc_dom_image
In reply to Koripella Srinivashi
I try to read the function of "int xc_dom_boot_image(structxc_dom_image *dom)",and I am confused about the two fields of struct xc_dom_image,p2m_guest and p2m_host, what are the meaning and functions of p2m_guest and p2m_host?
could you help me
Thanks in advance